import { createBehavior, createResource } from '@inbiz/core';
import { DnFC } from '@inbiz/react';
import { Html as PreviewHtml } from '../../preview/wap';
import { Html as LocaleHtml } from '../locale';
import { defaultProps, Html as SchemaHtml } from '../schema';

export const Html: DnFC<any> = PreviewHtml;

Html.Behavior = createBehavior({
  extends: ['Field'],
  name: 'Html',
  selector: (node: any) => node.props['x-component'] === 'Html',
  designerLocales: LocaleHtml,
  designerProps: SchemaHtml,
});

Html.Resource = createResource({
  icon: 'HTML',
  elements: [
    {
      componentName: 'Field',
      props: {
        type: 'sting',
        title: {
          value: 'Html.title',
          status: true,
        },
        'x-decorator': 'Container',
        'x-decorator-props': {},
        'x-component': 'Html',
        'x-component-props': defaultProps,
      },
    },
  ],
});

export default Html;
